
<script>
	import config from './config/index.js';
	import store from './store/index.js';
	
	export default {
		onLaunch: function() {
			config.config.requestArr = []			
			// store.dispatch('reloadToken')
			// 获取设备信息
			uni.getSystemInfo({
				success: res => {
					const { statusBarHeight, brand, pixelRatio } = res;
					const dpr = brand === "devtools" ? 1 : pixelRatio;
					
					store.commit('setStatusBarHeight', statusBarHeight);
					store.commit('setSystemDpr', dpr);
				}
			})
			// uni.login({
			// 	provider: 'weixin',
			// 	success: function(res) {
			// 		let appid = 'wxa472f45fe86816fa'
			// 		let secret = '3e865bde1e9c48785781e4186724b01c'
			// 		let url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' + appid + '&secret=' + secret + '&js_code=' +
			// 					res.code + '&grant_type=authorization_code';
			// 		uni.request({
			// 			url: url, // 请求路径
			// 			success: result => {
			// 					console.info(result.data.openid);
			// 				},
			// 			});
			// 		}
			// });			
		},
		onShow: function(option) {			
			if(option.path === 'pages/login/index') return 
			console.log('option',option)
			config.config.requestArr = [] 
			store.dispatch('reloadToken')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	/*每个页面公共css */
	page{
		background:rgb(249,250,254);
	}
	.container{
		padding: 0 16upx 0 16upx;
	}
	.main-color{
		color: #4F75BE;
	}
</style>
